let http = require('http')
let fs = require('fs')
let path = require('path')
let url = require('url')
let server = http.createServer(function(req, res){
    let refer = req.headers['referer'] || req.headers['refer']
    // 如果说有refer的话，则表示从HTML页面中引用过来的
    if(refer){
        let {hostname} = url.parse(req.refer, true)
         
    }
    res.setHeader('Content-Type', 'image/jpg')
    fs.createReadStream(path.join(__dirname, 'images/23.jpg'))
})